//导入express
const express = require("express");
const registerRoutes = require("./serv/router");

const app = express();
registerRoutes(app);

app.use(express.static("./app"));
const hostPage = "./app/index.html";

app.get("/", (req, res) => {
  res.redirect(hostPage);
});

//配置app监听3000端口
const port = 3000;
app.listen(port, () => {
  console.log(`请访问： http://127.0.0.1:${port}/`);
});
